package com.yu.blog.utils.servletUtils;

import jakarta.servlet.http.HttpServletRequest;

public class RequestUtil {

    /**
     * 获取文件或url的后缀名
     */
    public static String getExtensionName(HttpServletRequest request){
        String url=request.getRequestURI();
        String extension = "";
        int i = url.lastIndexOf('.');
        if (i > 0) {
            extension = url.substring(i + 1);
        }
        return extension;
    }

}
